import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 列表查询 */
export const getAchievTransList = (params?: object) => {
  return http.request<any>(
    "get",
    baseUrlApi("/achievement/transformation/page"),
    {
      params: filerEmptyVal(params)
    }
  );
};

/** 详情 */
export const getAchievTransDetail = (params?: object) => {
  return http.request<any>(
    "get",
    baseUrlApi("/achievement/transformation/detail"),
    {
      params: filerEmptyVal(params)
    }
  );
};

/** 新增 */
export const addAchievTrans = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/achievement/transformation/add"),
    {
      data: filerEmptyVal(data)
    }
  );
};

/** 审核 */
export const checkAchievTrans = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/achievement/transformation/examineStatus"),
    {
      data: filerEmptyVal(data)
    }
  );
};

/** 修改 */
export const upAchievTrans = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/achievement/transformation/update"),
    {
      data
    }
  );
};

/** 删除 */
export const delAchievTrans = (dataId?: number) => {
  return http.request<any>(
    "post",
    baseUrlApi("/achievement/transformation/delete?id=" + dataId)
  );
};
